ARD2  RC2
Airbag Reference Demonstrator using MPC5604P
MPC55xx_init_ram.c
00001 
00002 /*
00003  *
00004  * FILE : MPC55xx_init_debug.c
00005  *
00006  * DESCRIPTION:
00007  *  This file contains the MPC55xx derivative needed initializations. 
00008  *  MPC55xx_init_debug.c is only used when willing to debug in RAM. Otherwise, 
00009  *  MPC55xx_init.c shall be used.
00010  *  usr_init() is called by the startup code of the application at initialization time
00011  *  You can add needed hardware initializations here.
00012  */
00013 
00014 #include "Exceptions.h"     /* IVPR and default exception handlers setup */
00015 #include "IntcInterrupts.h" /* INTC Interrupts Requests configuration */
00016 #include "MPC5604P_HWInit.h"
00017 
00018 #pragma section code_type ".init"
00019 
00020 #define INIT_DERIVATIVE_INTERNAL_SETUP 0
00021 #define INIT_EXTERNAL_BUS_INTERFACE_SETUP 0
00022 
00023 #ifndef INIT_DERIVATIVE_INTERNAL_SETUP
00024 #pragma error INIT_DERIVATIVE_INTERNAL_SETUP should be defined !
00025 #endif
00026 
00027 #ifndef INIT_EXTERNAL_BUS_INTERFACE_SETUP
00028 #pragma error INIT_EXTERNAL_BUS_INTERFACE_SETUP should be defined !
00029 #endif
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034 
00035 extern __asm void __start();
00036 __asm void usr_init();
00037 /*lint -esym(752,__start) */
00038 
00039 #ifdef __cplusplus
00040 }
00041 #endif
00042 
00043 /*****************************************************************/
00044 /* usr_init():                                                   */
00045 /*   Define here the needed hardware initializations at startup  */
00046 
00047 __asm void usr_init()
00048 {
00049     /* Add needed hardware initializations in this function */
00050 
00051     nofralloc
00052 
00053     mflr     r30                         /* Save off return address in NV reg */
00054 
00055 #if INIT_DERIVATIVE_INTERNAL_SETUP==1
00056     bl      INIT_Derivative              /* Derivative specific hardware initializations */
00057 #endif
00058 #if INIT_EXTERNAL_BUS_INTERFACE_SETUP==1
00059     bl      INIT_ExternalBusAndMemory    /* Set up access to external memory (inc. chip select and MMU) */
00060 #endif
00061     bl      EXCEP_InitExceptionHandlers   /* Set up Default Exception handling */
00062     bl      INTC_InitINTCInterrupts       /* Set up INTC Interrupts Requests handling */
00063 
00064     mtlr    r30                          /* Get saved return address */
00065     
00066     blr
00067 }
00068 
00069 
00070